package com.itheima.TCPTest.test02;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;

public class Send {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.19.8",10000);

        OutputStream os = socket.getOutputStream();
        os.write("s".getBytes());
        socket.shutdownOutput();

        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String line;
        while ((line = br.readLine())!=null){
            System.out.println(line);
        }

        br.close();
        os.close();
        socket.close();
    }
}
